<style>
    
.status-1{color:blue;font-weight:bold}    
.status-0{color:red;font-weight:bold}    
.status-99{color:green;font-weight:bold}    
</style>

<?php
$this->breadcrumbs=array(
	'Users'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List User', 'url'=>array('index')),
	array('label'=>'Create User', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('user-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Users</h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
        'number',
		'email',
		'fullname',
		array(
            'name'=>'ctime',
            'value'=>'date("Y-m-d H:i", (float)$data->ctime)',
        ),
        array(
            'name'=>'mtime',
            'value'=>'date("Y-m-d H:i", (float)$data->mtime)',
        ),
        array(
            'class'=>'CButtonColumn',
        ),
        array(
            'class'=>'CLinkColumn',
            'header'=>'Attendances',
//            'labelExpression'=>'$data->getUser()->getDisplayName()',
            'urlExpression'=>'Yii::app()->createUrl("/attendance/list", array("id"=>$data->id))',
        ),
	),
)); ?>
